Rails.application.routes.draw do
  get "aistock/home"
  get "aistock/trade_review"
  get "aistock/limit_lists"
  require 'sidekiq/web'
  require 'sidekiq-scheduler/web'
  # or require 'sidekiq/pro/web'
  # or require 'sidekiq-ent/web'
  if Rails.env.production?
    Sidekiq::Web.use Rack::Auth::Basic do |username, password|
      ActiveSupport::SecurityUtils.secure_compare(username, ENV.fetch("USERNAME")) &&
        ActiveSupport::SecurityUtils.secure_compare(password, ENV.fetch("PASSWORD"))
    end
  end
  mount Sidekiq::Web => "/sidekiq" # mount Sidekiq::Web in your Rails app
  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)
  resources :home_tests
  # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

  # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
  # Can be used by load balancers and uptime monitors to verify that the app is live.
  get "up" => "rails/health#show", as: :rails_health_check

  # Render dynamic PWA files from app/views/pwa/*
  get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
  get "manifest" => "rails/pwa#manifest", as: :pwa_manifest

  # Defines the root path route ("/")
  root "home_tests#index"

  namespace :coze_api do
    resources :indexes, only: [:index, :show] do
      collection do
        get :daily_quotes
      end
    end
  end
end
